import Vue from 'vue'
import Router from 'vue-router'
import index from '../view/index/index'
import movie from '../view/index/movie/movie'
import user from '../view/index/user/user'
import discounts from '../view/index/discounts/discounts'
import cinema from '../view/index/cinema/cinema'
// import userInfo from '../view/index/user/userInfo/userInfo'
import login from '../view/others/login/login'
import register from '../view/others/register/register'
import about from '../view/others/about/about'
import setting from '../view/others/setting/setting'
import changePassword from '../view/others/changePassword/changePassword'
import feedback from '../view/others/feedback/feedback'
import saw from '../view/others/saw/saw'
import myCoupons from '../view/others/myCoupons/myCoupons'
import addCoupons from '../view/others/addCoupons/addCoupons'
Vue.use(Router)

export default new Router({
  linkActiveClass: 'active',//全局设置router选中状态类名为active
  routes: [
    {
      path: '/',
      // component: index
      redirect:'/index/movie'
    },
    {
      path:'/myCoupons',
      name:'myCoupons',
      component:myCoupons
    },
    {
      path:'/addCoupons',
      name:'addCoupons',
      component:addCoupons
    },
    {
      path:'/about',
      name:'about',
      component:about
    },
    {
      path:'/saw',
      name:'saw',
      component:saw
    },
    {
      path:'/feedback',
      name:'feedback',
      component:feedback
    },
    {
      path:'/changePassword',
      name:'changePassword',
      component:changePassword
    },
    {
      path:'/setting',
      name:'setting',
      component:setting
    },
    {
      path:'/login',
      name:'login',
      component:login
    },
    {
      path:'/register',
      name:'register',
      component:register
    },
    {
      path: '/index',
      name:'index',
      component: index,
      children:[
        {
          path:'movie',
          name:'movie',
          component:movie
        },
        {
          path:'user',
          name:'user',
          component:user,
        },
        {
          path:'discounts',
          name:'discounts',
          component:discounts
        },
        {
          path:'cinema',
          name:'cinema',
          component:cinema
        }
      ]
    }
  ]
})
